#!/bin/python3
import sys
import requests

inform = 1
alarm = sys.argv[2]
if "P1" in alarm:
    inform = 0

url = "http://prom.so.qihoo.net:8000/api/home/message/custom/send" 
payload = {
  "tousers": sys.argv[1].split(","),
  "msgtype": "text",
  "text": {
      "content": sys.argv[2]
  },
  "inform":inform
}
response = requests.post(url, json=payload, timeout=10)
print(response.json())
